/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: user
 * Date: 2023-10-23
 * Time: 17:42
 */
public class Test {

    public static void funcccc(int[] array) {

    }

    public static void funccccccccc() {
        int[] array = {1,2,3,4};
        funcccc(array);
    }






    public static void main(String[] args) {
        int[] array = {1,2,3,4};
        int a = 10;
    }













    public static void swap(int[] array) {
        int tmp = array[0];
        array[0] = array[1];
        array[1] = tmp;
    }

    public static void main9(String[] args) {
        int[] tmp = {1,2};
        System.out.println("交换前："+tmp[0]+" "+tmp[1]);
        swap(tmp);
        System.out.println("交换后："+tmp[0]+" "+tmp[1]);
    }

    public static int[] func3() {
        int[] tmp = {1,2,3,4,5,6,7};
        return tmp;
    }

    public static void main8(String[] args) {
        int a = 10;
        int[] ret = func3();
        System.out.println(Arrays.toString(ret));
    }

    public static void func1(int[] array) {
        array = new int[10];
    }

    public static void func2(int[] array) {
        array[0] = 99;
    }

    public static void main7(String[] args) {
        int[] array = {1,2,3,4};
        //func1(array);
        //func2(array);
        System.out.println(Arrays.toString(array));

    }

    public static void main6(String[] args) {
        int[] array = null;
        System.out.println(array.length);
    }

    public static void main5(String[] args) {
        int[] array = {1,2,3,4};
        int[] array2 = {4,5,6,7,8};
        array = array2;

        System.out.println(Arrays.toString(array));
        System.out.println(Arrays.toString(array2));
    }


    public static void main4(String[] args) {
        int[] array = {1,2,3,4};
        System.out.println(Arrays.toString(array));//1234

        int[] array2 = array;
        array2[1] = 99;
        System.out.println(Arrays.toString(array));//
        System.out.println(Arrays.toString(array2));//

    }
    public static void main3(String[] args) {
        int a = 10;
        int b = 20;
        int[] array = {1,2,3,4};
        System.out.println(array);
    }
    public static void main2(String[] args) {
        int[] array = {1,2,3,4};
        int[] array2 = new int[]{1,2,3,4};
        int[] array3 = new int[10];
    }

    public static void main1(String[] args) {
        int[] array = new int[100];
        for (int i = 0; i < array.length; i++) {
            array[i] = i+1;
        }
        String ret = Arrays.toString(array);
        System.out.println(ret);
    }
}
